<?php
namespace app\api\model;

use think\Model;
use think\Config;

class UserAuth extends Model
{
    protected $table = 'jk_user_authentications';

    //认证图片
    public function getPicAttr($value)
    {
        if(!empty($value)){
            $value = Config::get('web.pic_url')['auth'] . $value;
        }

        return $value;
    }

    //头像拼接域名
    public function getUserIconUrlAttr($value)
    {
        if(empty($value)){
            $res = Config::get('web.pic_url')['default'];
        } else{
            $res = Config::get('web.pic_url')['user'] . $value;
        }

        return $res;
    }
}
